#include <vector>
#include <map>
using namespace std;
#include<math.h>

class SparseTable {
public:
	SparseTable( vector<double> mass );
	~SparseTable() {}
	double RMQ( int begin, int end ) const;
private:
	vector<vector<double> > table;
	int length;
	int binaryPow( int k ) const;
	double min( double arg1, double arg2 ) const;
	static const double loge2;
};